class Solution(object):
    def prefixesDivBy5(self, nums):
        """
        :type nums: List[int]
        :rtype: List[bool]
        """
        t = 0
        out = [False] * (len(nums))
        for i in range(len(nums)):
            t = (t * 2 + nums[i]) % 5
            if t == 0:
                out[i] = True
            else:
                out[i] = False
        return out



data = Solution()
nums = [0, 1, 1]
print(data.prefixesDivBy5(nums))
